<template>
    <div>
        <!---->
        <mt-tab-container @bottom-bar="bottom" v-model="selected">
            <mt-tab-container-item id="首页"></mt-tab-container-item>
            <mt-tab-container-item id="我要报修"></mt-tab-container-item>
            <mt-tab-container-item id="维修入口"></mt-tab-container-item>
            <mt-tab-container-item id="物业管理"></mt-tab-container-item>
            <mt-tab-container-item id="报修查询"></mt-tab-container-item>
            <mt-tab-container-item id="个人中心"></mt-tab-container-item>
            <mt-tab-container-item id="用户管理"></mt-tab-container-item>
            <mt-tab-container-item id="公告管理"></mt-tab-container-item>
        </mt-tab-container>

        <mt-tabbar v-model="selected" fixed>
            <mt-tab-item id="首页">
                <img slot="icon" src="../assets/all.png" @click="shouye"/>
                首页
            </mt-tab-item>
            <mt-tab-item id="我要报修" v-if="ro_id == 3">
                <img slot="icon" src="../assets/add.png" @click="yezhuRepaire"/>
                我要报修
            </mt-tab-item>
            <mt-tab-item v-else-if="ro_id == 4" id="维修入口">
<<<<<<< HEAD
                <img slot="icon" src="../assets/repairedoor.png" @click="repaireY"/>
                维修入口
            </mt-tab-item>
            <mt-tab-item v-else-if="ro_id == 2" id="物业管理">
                <img slot="icon" src="../assets/wuyemanage.png" @click="wuyeManage"/>
                物业管理
            </mt-tab-item>
            <mt-tab-item v-else-if="ro_id == 1" id="公告管理">
                <img slot="icon" src="../assets/notice.png" @click="releaseManage"/>
                公告管理
            </mt-tab-item>
            <mt-tab-item v-if="ro_id == 3" id="报修查询">
                <img slot="icon" src="../assets/require.png" @click="queryRepaire"/>
                报修查询
            </mt-tab-item>
            <mt-tab-item v-else-if="ro_id == 1" id="用户管理">
                <img slot="icon" src="../assets/usermanage.png" @click="roleManage"/>
=======
                <img slot="icon" src="../assets/logo.png" @click="repaireY"/>
                维修入口
            </mt-tab-item>
            <mt-tab-item v-else-if="ro_id == 2" id="物业管理">
                <img slot="icon" src="../assets/logo.png" @click="wuyeManage"/>
                物业管理
            </mt-tab-item>
            <mt-tab-item v-else-if="ro_id == 1" id="公告管理">
                <img slot="icon" src="../assets/logo.png" @click="releaseManage"/>
                公告管理
            </mt-tab-item>
            <mt-tab-item v-if="ro_id != 1" id="报修查询">
                <img slot="icon" src="../assets/require.png" @click="queryRepaire"/>
                报修查询
            </mt-tab-item>
            <mt-tab-item v-else id="用户管理">
                <img slot="icon" src="../assets/logo.png" @click="roleManage"/>
>>>>>>> 70f7e19d6da4b30f0412d394b1171a015e63af36
                用户管理
            </mt-tab-item>
            <mt-tab-item id="个人中心">
                <img slot="icon" src="../assets/my.png" @click="my"/>
                个人中心
            </mt-tab-item>
        </mt-tabbar>
    </div>
</template>

<script>
    export default {
        /**
         * 添加一些测试用户，用于区分登陆后不同的界面
         */
        name: "",
        data() {
            return {
                selected: "首页",
                roId: "",
                repaire: {
                    type_id: "",
                    u_id: "",
                    repaire_desc: "",
                    repaire_status: "",
                    address: ""
                },
                ro_id: 0,
                seen: false,
                options: [
                    {
                        label: "电气维修",
                        value: "1"
                    },
                    {
                        label: "水暖",
                        value: "2"
                    },
                    {
                        label: "车辆管理",
                        value: "3"
                    },
                    {
                        label: "其它",
                        value: "4"
                    }
                ]
            };
        },
        methods: {
            bottom(ro_id) {
                console.log(ro_id);
            },
            shouye() {
                this.$router.replace({path: "/home"});
            },
            yezhuRepaire() {
<<<<<<< HEAD
=======
                alert(this.typeID);
>>>>>>> 70f7e19d6da4b30f0412d394b1171a015e63af36
                this.$router.replace({path: "/yezhuRepaire"});
            },
            queryRepaire() {
                this.$router.replace({path: "/queryRepaire"});
            },
            my() {
                this.$router.replace({path: "/my"});
            },
            repaireY() {
<<<<<<< HEAD
=======
                alert(this.ro_id);
>>>>>>> 70f7e19d6da4b30f0412d394b1171a015e63af36
                this.$router.replace({path: "/repaire"});
            },
            wuyeManage() {
                this.$router.replace({path: "/wuye"});
            },
            releaseManage() {
                this.$router.replace({path: "/release"});
            },
            roleManage() {
                this.$router.replace({path: "/role"});
            }
        },
        mounted() {
            let data = JSON.parse(localStorage.getItem("login_data"));
            console.log("用户角色id：" + data.ro_id);
            this.ro_id = data.ro_id;
            //alert(JSON.parse(localStorage.getItem("login_data").ro_id));
            // if(this.roName='维修人员'){
            //     this.seen=true;
            // }else {
            //     this.seen=false;
            // }
            // this.ro_id = this.roId;
            console.log("seen:" + this.seen);
            this.bottom();
        }
    };
</script>

<style scoped>
</style>